package com.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
//评论表
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@TableName("tb_comment")
public class CommentModel {
    @TableId(type = IdType.AUTO)
    private Integer id;//评论表ID
    private String content;//评论内容
    private Integer score;//得分1-5 1 2 3 4 5 最高5
    private Integer type;//1场地 2导师
    private String openId;//用户唯一id
    private Integer relationId;//关联场地或者导师ID
    private Integer commentType;//评论类型1 好评 2中评 3差评
    private Integer checkStatus;//审核状态 0 未通过 1通过

    @TableField(exist = false)
    private String typeText;//1场地 2导师
    @TableField(exist = false)
    private String checkStatusText;//审核状态 0 待审核 1 已审核

    @TableField(exist = false)
    private String scoreText;//转义 45好评  3中评  12差评

    @TableField(exist = false)
    private String userName;//用户名称
    @TableField(exist = false)
    private String faveUrl;//用户头像

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp updateTime;
}
